package com.atguigu.guli.service.ucenter.controller.admin;


import com.atguigu.guli.service.base.result.R;
import com.atguigu.guli.service.ucenter.entity.Member;
import com.atguigu.guli.service.ucenter.service.MemberService;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.sql.Date;

/**
 * <p>
 * 会员表 前端控制器
 * </p>
 *
 * @author atguigu
 * @since 2021-12-10
 */
@RestController
@RequestMapping("/admin/ucenter/member")
public class AdminMemberController {
    @Autowired
    MemberService memberService ;
    //管理员查询指定日期注册用户数量
    @GetMapping("getRegisterNum/{day}")
    public R getRegisterNum(@PathVariable String day) {
        QueryWrapper<Member> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("DATE(gmt_create)",day) ;
        int count = memberService.count(queryWrapper) ;
        return R.ok().data("num",count) ;
    }
}

